package com.itzdm.user.enums;

import lombok.Getter;

@Getter
public enum LoginType {
    EMAIL_PASSWORD(1, "邮箱密码登录"),
    EMAIL_CODE(2, "邮箱验证码登录"),
    TFID_PASSWORD(3, "TalkFlow ID密码登录");

    private final int code;
    private final String description;

    LoginType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static LoginType fromCode(int code) {
        for (LoginType type : values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("不支持的登录类型: " + code);
    }
} 